package org.mzx.shortLink.work.mq.producer;

import lombok.RequiredArgsConstructor;
import org.mzx.shortLink.work.common.constant.rabbitMq.rabbitMqShortLinkStatusDto;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import static org.mzx.shortLink.work.common.enums.rabbitMqData.SHORT_LINK_STATUS_EXCHANGE;
import static org.mzx.shortLink.work.common.enums.rabbitMqData.SHORT_LINK_STATUS_KEY;

@Component
@RequiredArgsConstructor
public class shortLinkStatusSaveProducer {
    private final RabbitTemplate rabbitTemplate;

    public void sendShortLinkStatus(rabbitMqShortLinkStatusDto statusDto) {
        rabbitTemplate.convertAndSend(SHORT_LINK_STATUS_EXCHANGE,SHORT_LINK_STATUS_KEY,statusDto);
    }
}
